﻿using GC_RF.DataAccess.Abstractions.Interfaces.Factories;
using GC_RF.DataAccess.Abstractions.Interfaces.Helpers;
using GC_RF.DataAccess.Abstractions.Interfaces.Repositories;
using GC_RF.DataAccess.Repositories;

namespace GC_RF.DataAccess.Factories
{
	public class RepositoryFactory : IRepositoryFactory
	{
		#region Variables

		private readonly IUnitOfWork _unitOfWork;

		#endregion

		#region Constructors

		public RepositoryFactory(IUnitOfWork unitOfWork)
		{
			_unitOfWork = unitOfWork;
		}

		#endregion

		#region IRepositoryFactory Members

		public IUserRepository CreateUserRepository()
		{
			return new UserRepository(_unitOfWork);
		}

		public IResetPasswordTokensRepository CreateResetPasswordTokensRepository()
		{
			return new ResetPasswordTokensRepository(_unitOfWork);
		}

		public INewsRepository CreateNewsRepository()
		{
			return new NewsRepository(_unitOfWork);
		}

		#endregion
	}
}
